#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N=2e5;
#define INF 0x7fffffff
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
int n;
void solve()
{
	sd(n);
	int mid=n/3+n%3;
	if(n%3<=1)
	{
		mid++;
		int l2=n/3;
		int r2=n/3-1;
		cout<<l2<<" "<<mid<<" "<<r2<<'\n';
		return;
	}
	else
	{
		int l=n/3+1;
		int r=n/3-1;
		cout<<l<<" "<<mid<<" "<<r<<'\n';
		return;
	}
	
}

int main()
{
	int T;
	sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}